<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>作品管理 - 我的</title>
<meta name="keywords" content="keywords" />
<meta name="description" content="description" />
<{include file="block/meta.tpl"}>
<link type="text/css" rel="stylesheet" href="<{$__HST_UI}>/css<{$_The.ScriptBase}>.css" />
</head>
<body>
<div id="wrap">
<{include file="block/header.tpl"}>

<div class="content">
	<{include file="block/left_my.tpl"}>
	<div>
<{if $sMsg}>
		<div><{$sMsg|escape:html}></div>
<{/if}>
<{if 'list' == $sAction}>
		<div><a href="?">我的作品集</a> - 列表展示</div>
		<div>
			<div><span>按类别查找：</span>
				<span><select onchange="location.href='?<{$rPager.Bse|build_query:"category:_"}>&category='+this.value;">
					<option value="0">&lt; 所有类别 &gt;</option>
<{section name=i loop=$rSlctCtgrys}>
	<option value="<{$rSlctCtgrys[i].id}>"<{if $rSlctCtgrys[i].id==$rP.category}> selected="selected"<{/if}>><{$rSlctCtgrys[i].BreadCrumb|escape:html}></option>
<{/section}>
				</select></span>
			</div>
<{section name=i loop=$rWorks}>
	<ul>
		<li>标题：<a href="?action=edit&id=<{$rWorks[i].id}>"><{$rWorks[i].title|escape:html}></a></li>
		<li>价格：<{$rWorks[i].price|escape:html}></li>
		<li>添加时间：<{$rWorks[i].time_added|escape:html}></li>
		<li><a href="?action=edit&id=<{$rWorks[i].id}>">修改</a></li>
	</ul>
<{sectionelse}>
	<ul><li>无记录</li></ul>
<{/section}>
			<div>
				<span>翻页条：</span>
<{html_pager max=$rPager.Max page=$rPager.Num
	link="<a href=\"?`$rPager.Bse`&`$rPager.Req`={X}\">{X}</a>"
	text="{X}"
}>
				<span>每页<{$rPager.Sze}>条</span>
			</div>
		</div>
<{elseif 'edit' == $sAction}>
		<div><a href="?">我的作品集</a> - 修改作品</div>
		<div>
			<form method="post">
			<input type="hidden" name="id" value="<{$rWork.id}>" />
			<table>
				<tr><td>所属类别：</td><td><select name="category_id">
<{section name=i loop=$rSlctCtgrys}>
	<option value="<{$rSlctCtgrys[i].id}>"<{if $rSlctCtgrys[i].id==$rP.category_id|default:$rWork.category_id}> selected="selected"<{/if}>><{$rSlctCtgrys[i].BreadCrumb|escape:html}></option>
<{/section}>
				</select></td></tr>
				<tr><td>标题：</td>
					<td><input type="text" name="title" value="<{$rP.title|default:$rWork.title|escape:html}>" /></td>
				</tr>
				<tr><td>描述：</td>
					<td><textarea name="description"><{$rP.description|default:$rWork.description|escape:html}></textarea></td>
				</tr>
				<tr><td>价格：</td>
					<td><input type="text" name="price" value="<{$rP.price|default:$rWork.price|escape:html}>" /></td>
				</tr>
				<tr><td>标签：</td>
					<td><input type="text" name="tags" value="<{$rP.tags|default:$rWork.tags|escape:html}>" /></td>
				</tr>
				<tr><td colspan="2">
					<input type="submit" value="保存修改" />
					<input type="hidden" name="action" value="update" />
					<a href="?">取消</a>
				</td></tr>
			</table>
			</form>
		</div>
<{elseif 'new' == $sAction}>
		<div><a href="?">我的作品集</a> - 添加作品</div>
		<div>
			<form method="post">
			<table>
				<tr><td>所属类别：</td><td><select name="category_id">
<{section name=i loop=$rSlctCtgrys}>
	<option value="<{$rSlctCtgrys[i].id}>"<{if $rSlctCtgrys[i].id==$rP.category_id|default:$rWork.category_id}> selected="selected"<{/if}>><{$rSlctCtgrys[i].BreadCrumb|escape:html}></option>
<{/section}>
				</select></td></tr>
				<tr><td>标题：</td>
					<td><input type="text" name="title" value="<{$rP.title|default:$rWork.title|escape:html}>" /></td>
				</tr>
				<tr><td>描述：</td>
					<td><textarea name="description"><{$rP.description|default:$rWork.description|escape:html}></textarea></td>
				</tr>
				<tr><td>价格：</td>
					<td><input type="text" name="price" value="<{$rP.price|default:$rWork.price|escape:html}>" /></td>
				</tr>
				<tr><td>标签：</td>
					<td><input type="text" name="tags" value="<{$rP.tags|default:$rWork.tags|escape:html}>" /></td>
				</tr>
				<tr><td colspan="2">
					<input type="submit" value="添加" />
					<input type="hidden" name="action" value="add" />
					<a href="?">取消</a>
				</td></tr>
			</table>
			</form>
		</div>
<{/if}>
		<div>
			<a href="/my/unit/work.php?action=new">添加作品</a>
		</div>
	</div>
</div>

<{include file="block/footer.tpl"}>
</div>
</body>
</html>
